const mongoose = require('mongoose');
//引入studentsModel和exercisesModel
require("./studentsModel");
require("./exercisesModel");

const collectionsSchema = new mongoose.Schema({
    studentId: {   // 所属学员 _id
        type: mongoose.Schema.Types.ObjectId,
        ref: 'studentsModel'
    },
    exerciseId: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'exercisesModel'
    }
});

mongoose.model('collectionsModel', collectionsSchema, 'collections');